package pta;/**
 * @author： li
 * @date： 2022-04-05 15:49
 * @version 1.0
 */
import java.io.*;
public class 阅览室 {
    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        int n=Integer.parseInt(in.readLine());
        while(n>0){
            String[] a =in.readLine().split(" ");
            int id = Integer.parseInt(a[0]);
            int count = 0;
            int total_t = 0;
            if(a[1].equals("S")){

            }
            System.out.println(count+" "+total_t);
            n--;
        }
    }
}
